package icom.acm.manager;

import icom.acm.bean.VIEW_USER_RELATION_ONLINE;
import icom.acm.util.DBConnect;

import java.util.ArrayList;
import java.util.List;

public class View_User_Relation_OnlineMgr {
	public List<VIEW_USER_RELATION_ONLINE> selectByUedId(Integer uid, DBConnect db){
		List<VIEW_USER_RELATION_ONLINE> list = new ArrayList<VIEW_USER_RELATION_ONLINE>();
		String sql = "SELECT * FROM VIEW_USER_RELATION_ONLINE WHERE VURO_UED_ID="+uid + " AND VURO_U_ID<>"+uid + " GROUP BY VURO_U_ID";
		
		db.prepareStatement(sql);
		db.excuteQuery();
		while (db.next()){
			VIEW_USER_RELATION_ONLINE e = new VIEW_USER_RELATION_ONLINE();
			e.set(db);
			list.add(e);
		}
		
		return list;
	}	
}
